package com.ruoyi.web.controller.nongjt.stats;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.nongjt.domain.vo.PiePictureVO;
import com.ruoyi.nongjt.service.PiePictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/nongjt/stats")
public class StatsController {
    @Autowired
    private PiePictureService piePictureService;
    @GetMapping("/getPiePicture/{year}")
    public AjaxResult getPiePictureByCheckYear(@PathVariable Integer year) {
        //System.out.println("year: " + year);
        List<PiePictureVO> piePictureVOList = piePictureService.getPiePictureDataByYear(year);
        //System.out.println(piePictureVOList + "------------------------------------------");
        return AjaxResult.success(piePictureVOList);
    }
}
